﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Entity;
using Utility;

namespace StudentAppointmentPlatform
{
    public partial class MessageBlock : System.Web.UI.UserControl
    {
        public Message Message { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void SetInfo()
        {
            MessageContent.InnerHtml = Message.MessageContent;
            if (!Message.IsRead)
            {
                btnRemove.Visible = true;
            }
        }

        protected void btnRemove_OnClick(object sender, EventArgs e)
        {
            Message.IsRead = true;
            MessageBO.UpdateMessageReadStatus(Message);
            Refresh.RefreshCurrentPage(Page);
        }
    }
}